package com.kk.Mapper;

import com.kk.Entry.Dept;
import com.kk.Entry.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 部门管理
 */
@Mapper
public interface DeptMapper {

    @Select("select * from formorder where name like '%' #{name} '%' ")
    List<Dept> inquire(String name);

    @Select("select * from dept ")
    List<Dept> selectDept();


    @Select("select * from formorder limit 0,5")
    List<Dept> inquireLimit();

    @Delete("delete from dept where id = #{id}")
    int delDep(Integer id);

    @Select("select * from dept where id = #{id}")
    Dept selectById(Integer id);

    int update(Dept dept);


    @Insert("insert into dept  values (null,#{name} ,#{createTime} , #{updateTime} )")
    int addDept(Dept dept);

    @Delete("delete from emp where dept_id = #{deptId};")
    int deleteEmpsByDepId(Integer empId);
}
